<template>
  <view class="main">
    <view class="box-left">
      <text>{{title}}</text>
      <text>{{desc}}</text>
    </view>
    <radio class="box-radio" color="#000" @click="chooseAddress"></radio>
  </view>
</template>

<script>
  import {mapMutations} from "vuex"
  export default {
    name:"my-addr",
    props:{
      title:{
        type:String,
        default:""
      },
      desc:{
        typep:String,
        default:""
      }
    },
    data() {
      return {
        
      };
    },
    methods:{
      ...mapMutations("user",["setAddress"]),
      //选择地址时
      chooseAddress(){
        this.setAddress({"title":this.title,"desc":this.desc})
        uni.navigateBack()
      }
    }
  }
</script>

<style lang="scss" scoped>
.main{
  border: 1px #000 solid;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20rpx;
  margin: 20rpx;
  .box-left{
    display: flex;
    flex-direction: column;
    text:nth-child(1){
      width: 600rpx;
      font-size: 20px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    text:nth-child(2){
      font-size: 18px;
      color:#b6b6b6
    }
  }
  .box-raido{

  }
}
</style>